/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.factory.web.service;

import com.factory.web.dto.UserDTO;
import com.factory.web.json.Problem;
import com.factory.web.dto.UserTaskDTO;
import com.factory.web.json.Plan;
import com.factory.web.json.Stats;
import com.factory.web.json.UsersWrapper;
import java.io.InputStream;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;

/**
 *
 * @author milos
 */
public interface FactoryServiceInterface {

    @PreAuthorize(
            "hasRole('ROLE_ADMIN') or "
    + "hasRole('ROLE_USER')")
    public boolean runFactory(Plan plan);

    @PreAuthorize(
            "hasRole('ROLE_ADMIN') or "
    + "hasRole('ROLE_USER')")
    public void upload(InputStream fileInStream);

    @PreAuthorize(
            "hasRole('ROLE_ADMIN') or "
    + "hasRole('ROLE_USER')")
    public InputStream getResultFile(String inputId);

    String getUserId();

    String getPasswordHash();

    void setUserId(String userId);

    void setPasswordHash(String passwordHash);

    @PreAuthorize(
            "hasRole('ROLE_ADMIN') or "
    + "hasRole('ROLE_USER')")
    public String getInputId();

    @PreAuthorize(
            "hasRole('ROLE_ADMIN') or "
    + "hasRole('ROLE_USER')")
    public List<UserTaskDTO> getUserTasks();

    @PreAuthorize(
            "hasRole('ROLE_ADMIN') or "
    + "hasRole('ROLE_USER')")
    public void setProblem(Problem problem);

    @PreAuthorize(
            "hasRole('ROLE_ADMIN') or "
    + "hasRole('ROLE_USER')")
    public Problem getProblem();

    public boolean register(UserDTO userDTO);

    @PreAuthorize(
            "hasRole('ROLE_ADMIN')")
    public List<UserDTO> getAllUsers();

    @PreAuthorize(
            "hasRole('ROLE_ADMIN')")
    public void updateUser(UserDTO userDTO);

    public String authorize(UserDTO userDTO);
    
        @PreAuthorize(
            "hasRole('ROLE_ADMIN')")
    public Stats getStats();
}
